package com.qk.mapper;

import com.qk.entity.Dept;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface DeptMapper {
    List<Dept> selectList(String name, Integer status);

    @Insert("INSERT INTO dept(name, status, create_time, update_time) " +
            "VALUES(#{name}, #{status}, #{createTime}, #{updateTime})")
    void insert(Dept dept);

    @Delete("delete from dept where id = #{id}")
    void deleteById(Integer id);

    @Select("select * from dept where id=#{id}")
    Dept selectById(Integer id);

   /* @Update("update dept set name=#{name}, status=#{status}, update_time=#{updateTime} where id=#{id}")*/
    void update(Dept dept);

    @Select("select id, name, status, create_time, update_time from dept where status=1")
    List<Dept> selectDept();
}

